import com.sun.deploy.uitoolkit.impl.fx.AppletStageManager;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 徐海涛
 * Date: 2021-11-16
 * Time: 0:18
 */
public class TestDemo {
    public static void main9(String[] args) {//作业2的第三钟写法
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        for (int i = 2; i <= n/2; i++) {
            if (n % i == 0) {
                System.out.println(n + "不是素数");
                break;
            }
            if (n/2 <= i ) {
                System.out.println(n + "是素数");
            }
        }
    }
    public static void main8(String[] args) { //用函数来表达作业2
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (n % i == 0) {
                System.out.println(n + "不是素数");
                break;
            }
            if (n % Math.sqrt(n) == 0) {
                System.out.println(n + "是素数");
            }
        }
    }
    public static void main7(String[] args) { //作业2！！！
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        for (int i = 2; i <= n; i++) {
            if (n % i == 0) {
                System.out.println(n + "不是素数");
                break;
            }
            if (n % i == 0) {
                System.out.println(n + "是素数");
            }
        }

    }
    public static void main6(String[] args) { //作业1！！！！！！
        Scanner scanner = new Scanner(System.in);
        int year = scanner.nextInt();
        if (year < 18) {
            System.out.println("是少年");
        }
        if (year > 19 && year < 28) {
            System.out.println("是青年");
        }
        if (year > 56) {
            System.out.println("是老年");
        }

    }


    public static void main5(String[] args) { //使用调用方法
        int a = 10;
        int b = 20;
        System.out.println("第一次调用方法之前");
        int ret = add(a, b);
        System.out.println("第一次调用方法之后");
        System.out.println("ret = " + ret);
        System.out.println("第二次调用方法之前");
        ret = add(30, 50);
        System.out.println("第二次调用方法之后");
        System.out.println("ret = " + ret);
    }

    public static void main4(String[] args) { //使用调用的方法计算两个整数相加~！！！
        int a = 10;
        int b = 20;
        System.out.println("第一次调用方法前");
        int ret = add(a, b);
        System.out.println("第一次调用方法之后");
        System.out.println("ret = " + ret);
        System.out.println("第二次调用方法之前");
        ret = add(30, 50);
        System.out.println("第二次调用方法之后");
        System.out.println("ret = " + ret);
    }
    public static int add(int x, int y) {
        System.out.println("调用方法中 x = " + x + "y = " + y);
        return  x + y;

    }

    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        System.out.println();
        int n = scanner.nextInt();
        double j = scanner.nextDouble();
        System.out.println();
    }
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double n = scanner.nextDouble();
        System.out.println(n);
    }
    public static void main1(String[] args) { //在键盘上输入
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(n);
    }
}
